#include <Wire.h>

#ifndef DigisparkOLEDM_H
#define DigisparkOLEDM_H

#define SSD1306		0x3C

class SSD1306Device: public Print
{
  public:
    SSD1306Device(void);
    void begin(void);
    void setCursor(uint8_t x, uint8_t y);
    void clear(void);
    virtual size_t write(byte c);
    using Print::write;
  private:
    void fill(uint8_t fill);
    void ssd1306_send_command(uint8_t command);
    void ssd1306_send_data_byte(uint8_t byte);
    void ssd1306_send_data_start(void);
    void ssd1306_send_data_stop(void);
    void ssd1306_send_command_start(void);
    void ssd1306_send_command_stop(void);
};
extern SSD1306Device oled;
#endif

